package com.peng.design.rule;

import java.util.ArrayList;
import java.util.List;

/**
 * SimpleRuleChain
 *
 * @author lupeng
 * Created on 2022-03-22
 */
public class SimpleRuleChain<T> implements RuleChain<T> {

    private List<Rule<T>> andRules = new ArrayList<>();
    private List<Rule<T>> orRules = new ArrayList<>();

    @Override
    public void and(Rule<T> rule) {
        andRules.add(rule);
    }

    @Override
    public void or(Rule<T> rule) {
        orRules.add(rule);
    }

    @Override
    public List<Rule<T>> getAndRules() {
        return andRules;
    }

    @Override
    public List<Rule<T>> getOrRules() {
        return orRules;
    }
}
